package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TurnoverRateMapper;
import com.ruoyi.system.domain.TurnoverRate;
import com.ruoyi.system.service.ITurnoverRateService;

/**
 * 成交率Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-13
 */
@Service
public class TurnoverRateServiceImpl implements ITurnoverRateService 
{
    @Autowired
    private TurnoverRateMapper turnoverRateMapper;

    /**
     * 查询成交率
     * 
     * @param id 成交率主键
     * @return 成交率
     */
    @Override
    public TurnoverRate selectTurnoverRateById(Integer id)
    {
        return turnoverRateMapper.selectTurnoverRateById(id);
    }

    /**
     * 查询成交率列表
     * 
     * @param turnoverRate 成交率
     * @return 成交率
     */
    @Override
    public List<TurnoverRate> selectTurnoverRateList(TurnoverRate turnoverRate)
    {
        return turnoverRateMapper.selectTurnoverRateList(turnoverRate);
    }

    /**
     * 新增成交率
     * 
     * @param turnoverRate 成交率
     * @return 结果
     */
    @Override
    public int insertTurnoverRate(TurnoverRate turnoverRate)
    {
        turnoverRate.setCreateTime(DateUtils.getNowDate());
        return turnoverRateMapper.insertTurnoverRate(turnoverRate);
    }

    /**
     * 修改成交率
     * 
     * @param turnoverRate 成交率
     * @return 结果
     */
    @Override
    public int updateTurnoverRate(TurnoverRate turnoverRate)
    {
        turnoverRate.setUpdateTime(DateUtils.getNowDate());
        return turnoverRateMapper.updateTurnoverRate(turnoverRate);
    }

    /**
     * 批量删除成交率
     * 
     * @param ids 需要删除的成交率主键
     * @return 结果
     */
    @Override
    public int deleteTurnoverRateByIds(Integer[] ids)
    {
        return turnoverRateMapper.deleteTurnoverRateByIds(ids);
    }

    /**
     * 删除成交率信息
     * 
     * @param id 成交率主键
     * @return 结果
     */
    @Override
    public int deleteTurnoverRateById(Integer id)
    {
        return turnoverRateMapper.deleteTurnoverRateById(id);
    }
}
